package cinema.model;

import cinema.service.*;
import cinema.util.*;

public class FrontDeskUser extends User {
    public FrontDeskUser(String id, String username, String password, String phone) {
        super(id, username, password, UserType.FRONT_DESK, phone);
    }

    @Override
    public void showMenu() {
        while (true) {
            System.out.println("\n===前台菜单===");
            System.out.println("1. 查看影片 2. 查看场次 3. 售票 4. 退票 5. 修改密码 6. 退出");
            switch (InputUtil.readInt("请选择: ")) {
                case 1 -> MovieService.listMovies();
                case 2 -> ShowtimeService.listShowtimes();
                case 3 -> TicketService.sellTicketUI();
                case 4 -> TicketService.refundTicketUI();
                case 5 -> {
                    changePassword(InputUtil.readLine("新密码: "));
                    Logger.log("前台修改密码", username);
                }
                case 6 -> { return; }
            }
        }
    }
}